﻿# 设置项目名称为 这两行根据模块变化
set(MY_PROJECT_NAME txr_algo_dlm_cls_v2_o)
add_definitions(-DTXR_ALGO_DLM_CLS_V2_O_LIB)

project(${MY_PROJECT_NAME} LANGUAGES CXX)

# Set compiler options for MSVC to use UTF-8 encoding
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

include_directories(
    ${BOOST_INCLUDEDIR}
    ${MY_OPENCV_INCLUDE_DIR}
    ${MY_OPENVINO_INCLUDE_DIR}
)

link_directories(
    ${Boost_LIBRARY_DIRS}
    ${MY_OPENCV_LIBS_DIR}
    ${MY_OPENVINO_LIB_DIR}
)

set(TXR_ALGO_DLM_O_LIBS 
    Qt5::Core
    Qt5::Gui
    dxgi 
    ${MY_OPENCV_LIBS}
    ${MY_OPENVINO_LIBS}
)

file(GLOB_RECURSE CURRENT_HEADERS  *.h *.hpp)
file(GLOB_RECURSE CURRENT_SOURCES  *.c *.cpp)
source_group("Include" FILES ${CURRENT_HEADERS}) 
source_group("Source" FILES ${CURRENT_SOURCES})

add_library(${MY_PROJECT_NAME} SHARED
    ${CURRENT_HEADERS} 
    ${CURRENT_SOURCES} 
)

target_link_libraries(${MY_PROJECT_NAME} PRIVATE 
    ${TXR_ALGO_DLM_O_LIBS}
)

install(TARGETS ${MY_PROJECT_NAME} DESTINATION 
    RUNTIME DESTINATION bin
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib
)
unset(MY_PROJECT_NAME)